﻿using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;

namespace MS.InformationManagement.WP.RecordCenter.BackdropMassUploader
{
    [ToolboxItemAttribute(false)]
    public class BackdropMassUploader : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/MS.InformationManagement.WP.RecordCenter/BackdropMassUploader/BackdropMassUploaderUserControl.ascx";
        private Support.Enums.ListUploadOperation _Operation;

        protected override void CreateChildControls()
        {
            BackdropMassUploaderUserControl control = Page.LoadControl(_ascxPath) as BackdropMassUploaderUserControl;
            control.Operation = Operation;
            Controls.Add(control);            
        }

        [Category("Configuración de la Carga")]
        [WebBrowsable(true)]
        [Personalizable(PersonalizationScope.Shared)]
        public Support.Enums.ListUploadOperation Operation {
            get { return _Operation; }
            set { _Operation = value; }
        }
    }
}
